From: Aleksander Jan Bajkowski Date: Sat, 15 Mar 2025 16:03:33 +0000 (+0100) Subject: iwinfo: add he and eht operation info to wifi scan X-Git-Url: http://git.openwrt.org/%22https:/collectd.org//%22http:/www.crowdsec.net/%22/%22https:/collectd.org/%22http:/www.crowdsec.net/%22?a=commitdiff_plain;h=917000075eb48c934f0a456be3b884758c376e0b;p=project%2Frpcd.git iwinfo: add he and eht operation info to wifi scan Iwinfo exports he and eht operation info useful to get channel info of nearby stations. Add these new info to ubus output. Signed-off-by: Aleksander Jan Bajkowski Link: https://github.com/openwrt/rpcd/pull/11 Signed-off-by: Robert Marko --- diff --git a/iwinfo.c b/iwinfo.c index ff0f38b..2a223ed 100644 --- a/iwinfo.c +++ b/iwinfo.c @@ -437,6 +437,22 @@ rpc_iwinfo_scan(struct ubus_context *ctx, struct ubus_object *obj, blobmsg_close_table(&buf, t); } + if (e->he_chan_info.center_chan_1) { + t = blobmsg_open_table(&buf, "he_operation"); + blobmsg_add_u32(&buf, "channel_width", eht_chan_width[e->he_chan_info.chan_width]); + blobmsg_add_u32(&buf, "center_freq_1", e->he_chan_info.center_chan_1); + blobmsg_add_u32(&buf, "center_freq_2", e->he_chan_info.center_chan_2); + blobmsg_close_table(&buf, t); + } + + if (e->eht_chan_info.center_chan_1) { + t = blobmsg_open_table(&buf, "eht_operation"); + blobmsg_add_u32(&buf, "channel_width", eht_chan_width[e->eht_chan_info.chan_width]); + blobmsg_add_u32(&buf, "center_freq_1", e->eht_chan_info.center_chan_1); + blobmsg_add_u32(&buf, "center_freq_2", e->eht_chan_info.center_chan_2); + blobmsg_close_table(&buf, t); + } + rpc_iwinfo_add_encryption("encryption", &e->crypto); blobmsg_close_table(&buf, d);